package com.hxwb.robot.controller;

import com.hxwb.robot.entity.LoginEntity;
import com.hxwb.robot.entity.RobotEntity;
import com.hxwb.robot.request.LoginReq;
import com.hxwb.robot.service.RobotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/robot")
public class LoginController {
    @Autowired
    private RobotService robotService;

    @PostMapping("/login")
    public String startRobot(@RequestBody LoginReq loginReq) {
        LoginEntity loginEntity = robotService.login(loginReq);
        if (null != loginEntity) {
            return "1";
        }

        return "2";
    }
}
